{extend name="public/container"}

{block name="head_top"}

<link href="{__ADMIN_PATH}plug/umeditor/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="{__ADMIN_PATH}plug/umeditor/third-party/jquery.min.js"></script>
<script type="text/javascript" src="{__ADMIN_PATH}plug/umeditor/third-party/template.min.js"></script>
<script type="text/javascript" charset="utf-8" src="{__ADMIN_PATH}plug/umeditor/umeditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="{__ADMIN_PATH}plug/umeditor/umeditor.js"></script>
<style>
    .wrapper-content {
        padding: 0 !important;
    }
</style>
{/block}
{block name="content"}
<div class="row">
   <div class="col-sm-12 panel panel-default" >
       <div class="panel-body" style="padding: 30px">
           <form class="layui-form" method="post" action="add_new">
               <!-- <div class="form-group">
                   <div class="col-md-12">
                       <div class="input-group">
                           <span class="input-group-addon">标题</span>
                           <input maxlength="64" placeholder="请在这里输入标题" name="title" class="layui-input" id="title" value="{$news.title}">
                           <input type="hidden"  id="id" value="{$news.id}">
                       </div>
                   </div>
               </div> -->
               <div class="layui-form-item">
                <label class="layui-form-label">标题</label>
                <div class="layui-input-block">
                  <input type="text" name="title" required  value="{$news?$news.title:''}" lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
                </div>
              </div>

              <div class="layui-form-item">
                <label class="layui-form-label">作者</label>
                <div class="layui-input-block">
                  <input type="text" name="author" required  value="{$news?$news.author:''}" lay-verify="required" placeholder="请输入作者" autocomplete="off" class="layui-input">
                </div>
              </div>
              <input type="hidden" name="id" value="{$news.id|default=0}">
              <div class="layui-form-item">
                <label class="layui-form-label">文章分类</label>
                <div class="layui-input-block">
                  <select name="type_id">
                      {volist name="all" key="key" id="vo"}
                            <option value="{$key}" {if in_array($key,$news['cid'])}selected{/if}>{$vo}</option>
                      {/volist}
                  </select>
                </div>
              </div>
               <!-- <div class="form-group">
                   <div class="col-md-12">
                       <div class="input-group">
                           <span class="input-group-addon">作者</span>
                           <input maxlength="8" placeholder="请输入作者" name="author" class="layui-input" id="author" value="{$news.author}">
                       </div>
                   </div>
               </div> -->
               <!-- <div class="form-group">
                   <div class="col-md-12">
                       <div class="input-group">
                           <span class="input-group-addon">文章分类</span>
                           <?php if(empty($all)){?>
                           <select data-placeholder="请先添加文章分类" class="chosen-select"  style="width:100%;" tabindex="4" name="type_id">
                               <?php }else{ ?>
                                   <select data-placeholder="选择文章分类" class="chosen-select"  style="width:100%;" tabindex="4" name="type_id" {eq name="$select" value="1"}disabled="disabled"{/eq}>
                               <?php }?>
                               {volist name="all" id="vo" key="k"}
                               {if condition="$key eq $cid"}
                               <option value="{$key}" selected hassubinfo="true" >{$vo}</option>
                               {elseif condition="in_array($key,$news['cid'])"}
                               <option value="{$key}" selected hassubinfo="true" >{$vo}</option>
                               {else/}
                               <option value="{$key}" hassubinfo="true" >{$vo}</option>
                               {/if}
                               {/volist}
                           </select></div>
                   </div>
               </div> -->
               <div class="layui-form-item">
                <label class="layui-form-label">图文封面</label>
                <div class="layui-input-block">
                    <a class="layui-btn" onClick="upload_img('thumb',{w:800,h:550})" type="button"><i class="layui-icon layui-icon-add-circle"></i>上传图片
                    </a>
                    <div class="albumList" id="albumList">
                        {if isset($news) && $news.image_input!=''}
                            <div class="album">
                                <img src="{$news.image_input}" alt="图片" lay-src="{$news.image_input}" data-tips-image>
                                <p class="layui-btn layui-btn-normal" style="display: block;" onclick="del_img(this)">删除</p>
                            </div>
                        {/if}
                    </div>
                </div>
                
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">文章简介</label>
                <div class="layui-input-block">
                    <textarea  id="synopsis" name="synopsis" class="layui-textarea" style="height:80px;resize:none;line-height:20px;color:#333;">{$news.synopsis}</textarea>
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label">文章内容</label>
                <div class="layui-input-block">
                    <textarea  id="myEditor" name="content" class="layui-textarea" style="height:80px;resize:none;line-height:20px;color:#333;">{$news.content}</textarea>
                </div>
            </div>
           
            <div class="layui-form-item">
                <label class="layui-form-label">是否显示banner</label>
                <div class="layui-input-block">
                  <input type="radio" name="is_banner" value="1" title="是" {eq name="news['is_banner']" value="0"}checked{/eq}>
                  <input type="radio" name="is_banner" value="0" title="否" {eq name="news['is_banner']" value="1"}checked{/eq}>
                </div>
              </div>

              <div class="layui-form-item">
                <label class="layui-form-label">是否显示热门</label>
                <div class="layui-input-block">
                  <input type="radio" name="is_hot" value="1" title="是" {eq name="news['is_hot']" value="0"}checked{/eq}>
                  <input type="radio" name="is_hot" value="0" title="否" {eq name="news['is_hot']" value="1"}checked{/eq}>
                </div>
              </div>
               <!-- <div class="form-group">
                   <div class="col-md-12">
                       <div class="form-control" style="height:auto">
                           <label style="color:#ccc">图文封面大图片设置</label>
                           <div class="row nowrap">
                               <div class="col-xs-3" style="width:160px">
                                   {if condition="$news['image_input']"}
                                   <div class="upload-image-box transition image_img" style="height: 80px;background-repeat:no-repeat;background-size:contain;background-image:url({$news['image_input']})">
                                       <input value="" type="hidden" name="local_url">
                                   </div>
                                   {else/}
                                   <div class="upload-image-box transition image_img" style="height: 80px;background-repeat:no-repeat;background-size:contain;background-image:url('/system/module/wechat/news/images/image.png')">
                                       <input value="" type="hidden" name="local_url">
                                   </div>
                                   {/if}
                               </div>
                               <div class="col-xs-6">
                                   <input type="file" class="upload" name="image" style="display: none;" id="image" />
                                   <br>
                                   <a class="btn btn-sm add_image upload_span">上传图片</a>
                                   <br>
                                   <br>
                               </div>
                           </div>
                           <input type="hidden" name="image" id="image_input" value="{$news['image_input']}"/>
                           <p class="help-block" style="margin-top:10px;color:#ccc">封面大图片建议尺寸：900像素 * 500像素</p>
                       </div>
                   </div>
               </div> -->
               <!-- <div class="form-group">
                   <div class="col-md-12">
                       <label style="color:#aaa">文章简介</label>
                       <textarea  id="synopsis" name="synopsis" class="layui-input" style="height:80px;resize:none;line-height:20px;color:#333;">{$news.synopsis}</textarea>
                   </div>
               </div>
               <div class="form-group">
                   <div class="col-md-12">
                       <label style="color:#aaa">文章内容</label>
                       <textarea type="text/plain" id="myEditor" style="width:100%;">{$news['content']}</textarea>
                   </div>
               </div> -->
          

               <div class="layui-form-item">
                <label class="layui-form-label">原文链接</label>
                <div class="layui-input-block">
                  <input type="text" name="url" required  value="{$news?$news.url:''}" placeholder="选填，填写之后在图文左下方会出现此链接" autocomplete="off" class="layui-input">
                </div>
              </div>

               <!-- <div class="form-group">
                   <div class="col-md-12">
                       <label style="display:block"><span style="color:#aaa;">原文链接<b>选填</b>，填写之后在图文左下方会出现此链接</span>
                           <input maxlength="200" name="url" class="layui-input" id="url" value="{$news.url}">
                       </label>
                   </div>
               </div> -->
               <div class="layui-form-item">
                <div class="layui-input-block">
                  <button class="layui-btn" lay-submit lay-filter="ajax_form_submit">立即提交</button>
                </div>
              </div>
           </form>
       </div>
   </div>
</div>
<script src="{__ADMIN_PATH}js/layuiList.js"></script>
{include file="public/editor" /}
{/block}

{block name="script"}


{/block}